package com.share.hope.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "posts_info")
@Schema(description = "论坛信息")
public class PostsInfo extends BaseEntity{

    @TableId(type = IdType.AUTO, value = "id")
    @Schema(description = "论坛信息唯一标识")
    private Long id;

    @TableField(value = "user_id")
    @Schema(description = "用户id")
    private Long userId;

    @TableField(exist = false)
    private String userName;

    @TableField(value = "content")
    @Schema(description = "帖子内容")
    private String content;

    @TableField(exist = false)
    private Long likes;

    @TableField(exist = false)
    private Long comments;

    @TableField(exist = false)
    private List<CommentInfo> comment;
}
